#include "comm.hpp"
#include <stdio.h>
int main()
{
  int fd = open(filename.c_str(), O_WRONLY);
  // 创建
  key_t key = Getkey();
  int shmid = Getshmid(key);

  // 关联
  char *s = (char *)shmat(shmid, nullptr, 0);
  std::cout << "映射完成" << std::endl;

  // TODO
  //...写入26个字符
  std::string  sa= "I am processA";
  int i=0;
  while(true)
  {
    s[i] = sa[i];
    i++;
    std::cout << "write: " <<  "done" << std::endl;
    sleep(2);

    //通知
    int code =1;
    write(fd,&code,sizeof(code));
  }
  // 取消关联
  shmdt(s);
  return 0;
}
